<extend name="Public/base"/>

<block name="body">
    <div style="">
            <!-- 标题栏 -->
        <form method="POST" id="list" action="{:U('sellpriceexport')}">
            <input type="hidden" name="batch" value="{$batch}">
            <input type="hidden" name="user" value="{$user}">
            <input type="hidden" name="BIN" value="{:I('BIN')}">
            <input type="hidden" name="pname" value="{:I('pname')}">
            <div class="main-title">
                <h2>销售价格</h2>
                <button type="submit" class=" confirm btn btn-default">导出</button>
            </div>
            <div class="cf">
                <div class="search-form fr cf">
                </div>
            </div>
        </form>
        <div class="cf">
            <div class="fl cf">
                <a href="{:U('gydinpriceupdate')}&batch={:I('batch')}" class="btn btn-danger ajax-get">更新进货价</a>
            </div>
            <div class="search-form fr cf">
                <div class="sleft" >
                    <input type="text"  name="BIN" class=" search-input form-control " value="{:I('BIN')}" placeholder="商品编码" style="height:28px;width: 120px;" />
                </div>
                <div class="sleft" >
                    <input type="text"  name="pname" class=" search-input form-control " value="{:I('pname')}" placeholder="商品名称" style="height:28px;width: 120px;" />
                    <a class="sch-btn" href="javascript:;" id="search" url="{:U('')}&batch={:I('batch')}"><i class="btn-search"></i></a>
                </div>
            </div>
        </div>
        <!-- 数据列表 -->
        <div class="data-table table-striped">
            <table>
                <thead>
                <tr>
                    <th>BIN</th>
                    <th>商品[规格]</th>
                    <th>成本</th>
                    <th>手工费</th>
                    <th>快递费</th>
                    <th>内包装费</th>
                    <th>外包装费</th>
                    <th>
                        商城<span class="glyphicon glyphicon-question-sign" title="含运120%"></span>
                    </th>
                    <th>
                        果饮店<span class="glyphicon glyphicon-question-sign" title="不含运110%"></span>
                    </th>
                    <th>
                        员工<span class="glyphicon glyphicon-question-sign" title="不含运115%"></span>
                    </th>
                    <th>
                        企事业<span class="glyphicon glyphicon-question-sign" title="不含运120%"></span>
                    </th>
                    <th >
                        批发<span class="glyphicon glyphicon-question-sign" title="不含运125%"></span>
                    </th>
                    <th >
                        外卖<span class="glyphicon glyphicon-question-sign" title="含运130%"></span>
                    </th>
                    <th >
                        广源<span class="glyphicon glyphicon-question-sign" title="不含运140%"></span>
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
                </thead>
                <tbody>
                    <volist name="_list" id="vo">
                        <tr >
                            <td>
                                <a href="{:U('gydinpriceupdate')}&batch={$vo.batch}&id={$vo.id}" class="ajax-get" style="text-decoration: none">
                                    <span style="margin-left: 10px;" class="glyphicon glyphicon-refresh" title="点击更新售价"></span>
                                </a>
                                {$vo.BIN}
                            </td>
                            <td>
                                {$vo.pname}[{$vo.BIN|get_name_by_id=###,'Material_product','BIN','spec'}]
                            </td>
                            <td>
                                {$vo.base_price}
                            </td>
                            <td>
                                {$vo.process_fee|num_round=###,2}
                            </td>
                            <td>
                                {$vo.gr_trans_fee|num_round=###,2}
                            </td>
                            <td>
                                {$vo.package_fee|num_round=###,2}
                            </td>
                            <td>
                                {$vo.subpro_fee_out|num_round=###,2}
                            </td>
                            <td>
                                {$vo['spec_price_sc']}
                            </td>
                            <td>
                                {$vo['spec_price_gyd']}
                            </td>
                            <td>
                                {$vo['spec_price_yg']}
                            </td>
                            <td>
                                {$vo['spec_price_qsy']}
                            </td>
                            <td>
                                {$vo['spec_price_pf']}
                            </td>
                            <td>
                                {$vo['spec_price_wm']}
                            </td>
                            <td>
                                {$vo['spec_price_gyds']}
                            </td>
                            <td>
                                <a  href="{:U('Dingjia/sellpricedel')}&id={$vo.id}" class="ajax-get confirm btn btn-danger">删除</a>
                            </td>
                        </tr>
                    </volist>
                </tbody>
            </table>
        </div>
        <div class="page">
            {$_page}
        </div>
    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

    <script type="text/javascript">
        $("#search").click(function(){
            var url = $(this).attr('url');
            var query  = $('.search-form').find('.search-input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            if( url.indexOf('?')>0 ){
                url += '&' + query;
            }else{
                url += '?' + query;
            }
            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function(e){
            if(e.keyCode === 13){
                $("#search").click();
                return false;
            }
        });
        highlight_subnav('{:U('Dingjia/batchlist')}');
    </script>
</block>
